import java.util.List;

public class Test1 {
    public static void main(String[] args) {
        // 在遍历的时候进行添加或者删除是会抛出异常的
        List<String> names = List.of("a","b","c","d");
        for (String name : names){
            if("b".equals(name)){
                //names.remove(name);
                names.add("bb");
            }
        }
    }
}
